package com.cn.dhc.cssdemo;


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Servlet extends HttpServlet {

	private static final long serialVersionUID = 1833123112362424925L;

	private InvoiceService invoiceService=new InvoiceService();

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		List<Invoice> invoices=invoiceService.select(request.getParameter("username"));
		String html="<html...>";
		for(Invoice invoice:invoices){
			html+=invoice.getId()+" "+invoice.getHeader();
		}
		response.getWriter().write(html);
		//invoice.js
		//redirect,Sping Container.dependency
		//EL
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	
	}
	
}
